package com.beiing.tianshuai.tianshuai.huodong.presenter;

import com.beiing.tianshuai.tianshuai.base.BasePresenter;
import com.beiing.tianshuai.tianshuai.entity.EventTypesBean;
import com.beiing.tianshuai.tianshuai.huodong.model.EventsModel;
import com.beiing.tianshuai.tianshuai.huodong.model.EventsModelImpl;
import com.beiing.tianshuai.tianshuai.huodong.view.EventsViewImpl;

/**
 * Description :
 *
 * @author Jinda Yang
 * @date 2018/5/30
 */
public class EventsPresenter extends BasePresenter implements EventsPresenterImpl, EventsModel.OnResponseListener {

    private EventsViewImpl mView;
    private EventsModelImpl mModel;

    public EventsPresenter(EventsViewImpl view) {
        mView = view;
        mModel = new EventsModel(this);
    }

    @Override
    public void getEventTypes(String uid) {
        mView.showProgress();
        mModel.getEventTypes(uid);
    }

    @Override
    public void onGetEventTypesSuccess(EventTypesBean bean) {
        mView.hideProgress();
        mView.onRequestSuccess(bean);
    }

    @Override
    public void onGetEventTypesError(Throwable throwable) {
        mView.hideProgress();
        mView.onRequestFailed(throwable);
    }
}
